/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "prova")
@NamedQueries({
    @NamedQuery(name = "Prova.findAll", query = "SELECT p FROM Prova p"),
    @NamedQuery(name = "Prova.findByCdProva", query = "SELECT p FROM Prova p WHERE p.cdProva = :cdProva"),
    @NamedQuery(name = "Prova.findByVlNota", query = "SELECT p FROM Prova p WHERE p.vlNota = :vlNota"),
    @NamedQuery(name = "Prova.findByCdAluno", query = "SELECT p FROM Prova p WHERE p.cdAluno = :cdAluno"),
    @NamedQuery(name = "Prova.findByCdAvaliacao", query = "SELECT p FROM Prova p WHERE p.cdAvaliacao = :cdAvaliacao")})
public class Prova implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cd_prova")
    private Integer cdProva;
    @Column(name = "vl_nota")
    private Double vlNota;
    @Column(name = "cd_aluno")
    private Integer cdAluno;
    @Column(name = "cd_avaliacao")
    private Integer cdAvaliacao;

    public Prova() {
    }

    public Prova(Integer cdProva) {
        this.cdProva = cdProva;
    }

    public Integer getCdProva() {
        return cdProva;
    }

    public void setCdProva(Integer cdProva) {
        this.cdProva = cdProva;
    }

    public Double getVlNota() {
        return vlNota;
    }

    public void setVlNota(Double vlNota) {
        this.vlNota = vlNota;
    }

    public Integer getCdAluno() {
        return cdAluno;
    }

    public void setCdAluno(Integer cdAluno) {
        this.cdAluno = cdAluno;
    }

    public Integer getCdAvaliacao() {
        return cdAvaliacao;
    }

    public void setCdAvaliacao(Integer cdAvaliacao) {
        this.cdAvaliacao = cdAvaliacao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdProva != null ? cdProva.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Prova)) {
            return false;
        }
        Prova other = (Prova) object;
        if ((this.cdProva == null && other.cdProva != null) || (this.cdProva != null && !this.cdProva.equals(other.cdProva))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Prova[cdProva=" + cdProva + "]";
    }

}
